package vn.gq.tym.storytemplate;

import com.google.analytics.tracking.android.GoogleAnalytics;
import com.google.analytics.tracking.android.Tracker;

import android.content.Context;

public class GAManager {
	public String TRACKING_ID = "UA-37707941-1";
	private GoogleAnalytics mGoogleAnalytics;
	private Tracker mTracker;
	
	public GAManager(Context context) {
		mGoogleAnalytics = GoogleAnalytics.getInstance(context);
		mTracker = mGoogleAnalytics.getTracker(TRACKING_ID);
	}
	
	public static GAManager newInstance(Context context) {
		return new GAManager(context);
	}
	
	public void track(String name) {
		mTracker.trackView(name);
	}
	
	public void onStop() {
		mTracker.close();
	}
	
	
}
